package org.jeecg.modules.hc.service;

import com.aliyuncs.exceptions.ClientException;
import me.chanjar.weixin.common.error.WxErrorException;
import org.jeecg.modules.hc.entity.HcSiteAddressDetails;
import org.jeecg.modules.hc.entity.HcUser;
import com.baomidou.mybatisplus.extension.service.IService;

import java.io.UnsupportedEncodingException;
import java.util.HashMap;

/**
 * @Description: 用户
 * @Author: jeecg-boot
 * @Date:   2022-12-13
 * @Version: V1.0
 */
public interface IHcUserService extends IService<HcUser> {

    void setWalletBalance(HcUser hcUser);

    void setOpenId(String code, String userId) throws WxErrorException;

    void sendSms(String phone) throws UnsupportedEncodingException, ClientException;

    /**
     * 校验用户保存的地址是否在系统中存在或者被更改
     * @param hcUser
     * @return
     */
    HcSiteAddressDetails checkAddress(HcUser hcUser);

    /**
     * 微信登录
     * @param code
     * @return
     */
    HashMap<String, Object> loginForWx(String code) throws Exception;

    /**
     * 登录
     * @param phone
     * @param smsCode
     * @return
     */
    HcUser login(String phone, String smsCode);

}
